<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QxOrm: C:/Dvlp/_Perso/QxOrm/include/QxModelView/QxNestedModel.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_qxorm.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QxOrm
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
   <div id="projectbrief">C++ Object Relational Mapping library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_qx_nested_model_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">QxNestedModel.h</div>  </div>
</div>
<div class="contents">
<a href="_qx_nested_model_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/****************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">**</span>
<a name="l00003"></a>00003 <span class="comment">** http://www.qxorm.com/</span>
<a name="l00004"></a>00004 <span class="comment">** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)</span>
<a name="l00005"></a>00005 <span class="comment">**</span>
<a name="l00006"></a>00006 <span class="comment">** This file is part of the QxOrm library</span>
<a name="l00007"></a>00007 <span class="comment">**</span>
<a name="l00008"></a>00008 <span class="comment">** This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">** warranty. In no event will the authors be held liable for any</span>
<a name="l00010"></a>00010 <span class="comment">** damages arising from the use of this software</span>
<a name="l00011"></a>00011 <span class="comment">**</span>
<a name="l00012"></a>00012 <span class="comment">** Commercial Usage</span>
<a name="l00013"></a>00013 <span class="comment">** Licensees holding valid commercial QxOrm licenses may use this file in</span>
<a name="l00014"></a>00014 <span class="comment">** accordance with the commercial license agreement provided with the</span>
<a name="l00015"></a>00015 <span class="comment">** Software or, alternatively, in accordance with the terms contained in</span>
<a name="l00016"></a>00016 <span class="comment">** a written agreement between you and Lionel Marty</span>
<a name="l00017"></a>00017 <span class="comment">**</span>
<a name="l00018"></a>00018 <span class="comment">** GNU General Public License Usage</span>
<a name="l00019"></a>00019 <span class="comment">** Alternatively, this file may be used under the terms of the GNU</span>
<a name="l00020"></a>00020 <span class="comment">** General Public License version 3.0 as published by the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">** Foundation and appearing in the file &#39;license.gpl3.txt&#39; included in the</span>
<a name="l00022"></a>00022 <span class="comment">** packaging of this file. Please review the following information to</span>
<a name="l00023"></a>00023 <span class="comment">** ensure the GNU General Public License version 3.0 requirements will be</span>
<a name="l00024"></a>00024 <span class="comment">** met : http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00025"></a>00025 <span class="comment">**</span>
<a name="l00026"></a>00026 <span class="comment">** If you are unsure which license is appropriate for your use, or</span>
<a name="l00027"></a>00027 <span class="comment">** if you have questions regarding the use of this file, please contact :</span>
<a name="l00028"></a>00028 <span class="comment">** contact@qxorm.com</span>
<a name="l00029"></a>00029 <span class="comment">**</span>
<a name="l00030"></a>00030 <span class="comment">****************************************************************************/</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef _QX_NESTED_MODEL_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define _QX_NESTED_MODEL_H_</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;boost/static_assert.hpp&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;boost/mpl/if.hpp&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;boost/mpl/logical.hpp&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;boost/type_traits/is_pointer.hpp&gt;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;boost/type_traits/is_same.hpp&gt;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;boost/type_traits/is_base_of.hpp&gt;</span>
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;<a class="code" href="_qx_convert_8h.html" title="qx::cvt : namespace to provide global functions to convert any kind of objects to/from QString and QV...">QxConvert/QxConvert.h</a>&gt;</span>
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="preprocessor">#include &lt;<a class="code" href="_qx_collection_8h.html" title="QxOrm container (keep insertion order + quick access by index + quick access by key)">QxCollection/QxCollection.h</a>&gt;</span>
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="preprocessor">#include &lt;<a class="code" href="is__qx__registered_8h.html" title="qx::trait::is_qx_registered&lt;T&gt;::value : return true if T is registered into QxOrm context to provide ...">QxTraits/is_qx_registered.h</a>&gt;</span>
<a name="l00058"></a>00058 <span class="preprocessor">#include &lt;<a class="code" href="is__container_8h.html" title="qx::trait::is_container&lt;T&gt;::value : return true if T is a container from stl, boost, Qt or QxOrm library, otherwise return false">QxTraits/is_container.h</a>&gt;</span>
<a name="l00059"></a>00059 <span class="preprocessor">#include &lt;<a class="code" href="is__smart__ptr_8h.html" title="qx::trait::is_smart_ptr&lt;T&gt;::value : return true if T is a smart-pointer of boost, Qt or QxOrm librari...">QxTraits/is_smart_ptr.h</a>&gt;</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &lt;<a class="code" href="get__base__class_8h.html" title="qx::trait::get_base_class&lt;T&gt;::type : retrieve base class of type T registered into QxOrm context and ...">QxTraits/get_base_class.h</a>&gt;</span>
<a name="l00061"></a>00061 <span class="preprocessor">#include &lt;<a class="code" href="get__class__name__primitive_8h.html" title="Register all primitive and useful types of stl, boost and Qt libraries using QX_REGISTER_CLASS_NAME(T...">QxTraits/get_class_name_primitive.h</a>&gt;</span>
<a name="l00062"></a>00062 <span class="preprocessor">#include &lt;<a class="code" href="construct__ptr_8h.html" title="qx::trait::construct_ptr&lt;T&gt;::get(T &amp; t) : instantiate a new pointer, support both nude-pointer and sm...">QxTraits/construct_ptr.h</a>&gt;</span>
<a name="l00063"></a>00063 <span class="preprocessor">#include &lt;<a class="code" href="generic__container_8h.html" title="qx::trait::generic_container&lt;T&gt; : provide some tools to manage all containers without knowing its typ...">QxTraits/generic_container.h</a>&gt;</span>
<a name="l00064"></a>00064 <span class="preprocessor">#include &lt;<a class="code" href="is__valid__primary__key_8h.html" title="qx::trait::is_valid_primary_key&lt;T&gt;(const T &amp; t) : return true if t can be a valid primary key to be i...">QxTraits/is_valid_primary_key.h</a>&gt;</span>
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 <span class="preprocessor">#include &lt;<a class="code" href="_qx_clone_8h.html" title="Clone all classes registered into QxOrm context using QxOrm library serialization engine...">QxSerialize/QxClone.h</a>&gt;</span>
<a name="l00067"></a>00067 
<a name="l00068"></a>00068 <span class="preprocessor">#include &lt;<a class="code" href="_ix_model_8h.html" title="Interface to manage Qt model/view architecture with classes registered into QxOrm context (Qt widgets...">QxModelView/IxModel.h</a>&gt;</span>
<a name="l00069"></a>00069 <span class="preprocessor">#include &lt;<a class="code" href="_qx_model_8h.html" title="All classes registered into QxOrm context can be used with Qt model/view architecture (Qt widgets and...">QxModelView/QxModel.h</a>&gt;</span>
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="keyword">namespace </span>qx {
<a name="l00072"></a>00072 <span class="keyword">namespace </span>model_view {
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00075"></a>00075 <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="group___qx_model_view.html#ga9e77a51135648a509862472efb28d6dd" title="qx::model_view::create_nested_model is used by QxEntityEditor to manage complex data structure to wor...">create_nested_model</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, T &amp; t);
<a name="l00076"></a>00076 
<a name="l00077"></a>00077 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="namespaceqx_1_1model__view.html#a9aac50c627ca489db543c8aad5f238af">sync_nested_model</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, T &amp; t);
<a name="l00079"></a>00079 
<a name="l00080"></a>00080 } <span class="comment">// namespace model_view</span>
<a name="l00081"></a>00081 } <span class="comment">// namespace qx</span>
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="keyword">namespace </span>qx {
<a name="l00084"></a>00084 <span class="keyword">namespace </span>model_view {
<a name="l00085"></a>00085 <span class="keyword">namespace </span>detail {
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00088"></a>00088 <span class="keyword">struct </span>QxNestedModel;
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 <span class="keyword">template</span> &lt;<span class="keyword">class </span>T, <span class="keywordtype">bool</span> bIsQObject <span class="comment">/* = false */</span>&gt;
<a name="l00091"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html">00091</a> <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html">QxNestedModel_Helper</a>
<a name="l00092"></a>00092 {
<a name="l00093"></a>00093 
<a name="l00094"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html#a7b79380db906ee137df5d6894c7bc857">00094</a>    <span class="keyword">static</span> qx_shared_ptr&lt;T&gt; <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html#a7b79380db906ee137df5d6894c7bc857">clone</a>(T &amp; t)
<a name="l00095"></a>00095    { qx_shared_ptr&lt;T&gt; p; p.reset(<span class="keyword">new</span> T()); (* p) = t; <span class="keywordflow">return</span> p; }
<a name="l00096"></a>00096 
<a name="l00097"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html#a943ae995bff282481ebf2bf40a6e9e0e">00097</a>    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html#a943ae995bff282481ebf2bf40a6e9e0e">synchronize</a>(T &amp; t1, T &amp; t2)
<a name="l00098"></a>00098    { t1 = t2; }
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 };
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00103"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper_3_01_t_00_01true_01_4.html">00103</a> <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html">QxNestedModel_Helper</a>&lt;T, true&gt;
<a name="l00104"></a>00104 {
<a name="l00105"></a>00105 
<a name="l00106"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper_3_01_t_00_01true_01_4.html#a86adc4065e2d9fd654573951f0f70aa1">00106</a>    <span class="keyword">static</span> qx_shared_ptr&lt;T&gt; <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html#a7b79380db906ee137df5d6894c7bc857">clone</a>(T &amp; t)
<a name="l00107"></a>00107    { qx_shared_ptr&lt;T&gt; p; p.reset(<a class="code" href="group___qx_serialize.html#ga70251e58d27a4dde7566d2cb2b669966" title="qx::clone_to_nude_ptr(const T &amp; obj) : return a nude pointer (be careful with memory leak) of a new i...">qx::clone_to_nude_ptr</a>(t)); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(p); <span class="keywordflow">return</span> p; }
<a name="l00108"></a>00108 
<a name="l00109"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper_3_01_t_00_01true_01_4.html#ac4786f79d02c66aad0bd25688ab0c2f9">00109</a>    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html#a943ae995bff282481ebf2bf40a6e9e0e">synchronize</a>(T &amp; t1, T &amp; t2)
<a name="l00110"></a>00110    {
<a name="l00111"></a>00111       <a class="code" href="classqx_1_1_ix_class.html" title="qx::IxClass : common interface for all classes registered into QxOrm context">qx::IxClass</a> * pClass = <a class="code" href="classqx_1_1_qx_class.html" title="qx::QxClass&lt;T&gt; : concrete class of type T registered into QxOrm context (this class is a singleton an...">qx::QxClass&lt;T&gt;::getSingleton</a>();
<a name="l00112"></a>00112       <a class="code" href="classqx_1_1_ix_data_member_x.html" title="qx::IxDataMemberX : common interface for a list of IxDataMember class properties registered into QxOr...">qx::IxDataMemberX</a> * pDataMemberX = (pClass ? pClass-&gt;<a class="code" href="classqx_1_1_ix_class.html#a668a6091e56a8133606e64cba430baa4">getDataMemberX</a>() : NULL);
<a name="l00113"></a>00113       <span class="keywordflow">for</span> (<span class="keywordtype">long</span> l = 0; (pDataMemberX &amp;&amp; (l &lt; pDataMemberX-&gt;<a class="code" href="classqx_1_1_ix_data_member_x.html#a18a059cb07e8fcfe57e8de65930f1eb4">count_WithDaoStrategy</a>())); l++)
<a name="l00114"></a>00114       {
<a name="l00115"></a>00115          <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">qx::IxDataMember</a> * pDataMember = pDataMemberX-&gt;<a class="code" href="classqx_1_1_ix_data_member_x.html#a85c9ce031745f0ec8ffa9ec786d9185d">get_WithDaoStrategy</a>(l); <span class="keywordflow">if</span> (! pDataMember) { <span class="keywordflow">continue</span>; }
<a name="l00116"></a>00116          QVariant value = pDataMember-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aeb41e750a0e5ae206fe671cb94c7eb0f">toVariant</a>(&amp; t2);
<a name="l00117"></a>00117          pDataMember-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#ab745b2a043797eecfe769c3f51257a35">fromVariant</a>((&amp; t1), value);
<a name="l00118"></a>00118       }
<a name="l00119"></a>00119    }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 };
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00124"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html">00124</a> <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html">QxNestedModel_Generic</a>
<a name="l00125"></a>00125 {
<a name="l00126"></a>00126 
<a name="l00127"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a8553265289a7892e51c96db7f2766b4f">00127</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_collection.html">qx::QxModel&lt;T&gt;::type_collection</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a8553265289a7892e51c96db7f2766b4f">type_collection</a>;
<a name="l00128"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a30c3d15b05564c91d866b63b8a871884">00128</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_model.html#a2d1a76e9a19ad15e645dbd6605fa7f3f">qx::QxModel&lt;T&gt;::type_primary_key</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a30c3d15b05564c91d866b63b8a871884">type_primary_key</a>;
<a name="l00129"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#aaf568385fe70d3d9d57a513a66d0e288">00129</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_model.html#aef823670a8fc66b5d0c8d887034b45a6">qx::QxModel&lt;T&gt;::type_ptr</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#aaf568385fe70d3d9d57a513a66d0e288">type_ptr</a>;
<a name="l00130"></a>00130 
<a name="l00131"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#ae05886d8fc7ffd9f8351c858af55b014a520eb22cbbec8f23af5c930c95c84013">00131</a>    <span class="keyword">enum</span> { <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#ae05886d8fc7ffd9f8351c858af55b014a520eb22cbbec8f23af5c930c95c84013">is_valid</a> = <a class="code" href="structqx_1_1trait_1_1is__qx__registered.html" title="qx::trait::is_qx_registered&lt;T&gt;::value : return true if T is registered into QxOrm context to provide ...">qx::trait::is_qx_registered&lt;T&gt;::value</a> };
<a name="l00132"></a>00132 
<a name="l00133"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#ae491eb3c174229486c48b2cf4b301599">00133</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#ae491eb3c174229486c48b2cf4b301599">create</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, T &amp; t)
<a name="l00134"></a>00134    {
<a name="l00135"></a>00135       BOOST_STATIC_ASSERT(<a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#ae05886d8fc7ffd9f8351c858af55b014a520eb22cbbec8f23af5c930c95c84013">is_valid</a>);
<a name="l00136"></a>00136       <a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;T&gt;</a> * pModel = <span class="keyword">new</span> <a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;T&gt;</a>(pParent);
<a name="l00137"></a>00137       pModel-&gt;<a class="code" href="classqx_1_1_ix_model.html#ad313976add4e78d170581acc9573182e">setParentModel</a>(pParent);
<a name="l00138"></a>00138       <a class="code" href="classqx_1_1_qx_collection.html">type_collection</a> &amp; model = pModel-&gt;<a class="code" href="classqx_1_1_qx_model.html#af224b3a787360a263078e2d3c0ea843a" title="Model associated to a class registered into QxOrm context.">m_model</a>;
<a name="l00139"></a>00139       <span class="keywordtype">long</span> &amp; idx = pModel-&gt;<a class="code" href="classqx_1_1_qx_model.html#a37883f4d4971163c4e4b9c8cc7fb29ef" title="Index to insert manually items to the collection.">m_lManualInsertIndex</a>;
<a name="l00140"></a>00140       <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a30c3d15b05564c91d866b63b8a871884">type_primary_key</a> key;
<a name="l00141"></a>00141 
<a name="l00142"></a>00142       pModel-&gt;beginInsertRows(idxParent, 0, 0);
<a name="l00143"></a>00143       <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#aaf568385fe70d3d9d57a513a66d0e288">type_ptr</a> ptr = <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html">qx::model_view::detail::QxNestedModel_Helper&lt;T, boost::is_base_of&lt;QObject, T&gt;::value</a>&gt;<a class="code" href="group___qx_serialize.html#ga80162fe005f1f828a4589defaca4402f" title="qx::clone(const T &amp; obj) : return a boost smart-pointer (qx_shared_ptr&lt;T&gt;) of a new instance of type ...">::clone</a>(t);
<a name="l00144"></a>00144       <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">qx::IxDataMember</a> * pDataMemberId = pModel-&gt;<a class="code" href="classqx_1_1_ix_model.html#ade76aa8736c82f2d43e09d38f0b9f933" title="Primary key (property id) defined into QxOrm context.">m_pDataMemberId</a>;
<a name="l00145"></a>00145       <span class="keywordflow">if</span> (! pDataMemberId) { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); pModel-&gt;endInsertRows(); <span class="keywordflow">return</span> pModel; }
<a name="l00146"></a>00146       QVariant value = pDataMemberId-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aeb41e750a0e5ae206fe671cb94c7eb0f">toVariant</a>(&amp; t);
<a name="l00147"></a>00147       <span class="keywordflow">if</span> (! <a class="code" href="namespaceqx_1_1trait.html#a752ada47a935cfc82ffe1b17dadd6e72">qx::trait::is_valid_primary_key</a>(value))
<a name="l00148"></a>00148       { idx--; value = QVariant(static_cast&lt;qlonglong&gt;(idx)); }
<a name="l00149"></a>00149       <a class="code" href="namespaceqx_1_1cvt.html#a38fbb18bd04613956f3900604f5746be">qx::cvt::from_variant</a>(value, key);
<a name="l00150"></a>00150       model.<a class="code" href="classqx_1_1_qx_collection.html#a0f4fa1d6008d5910103be9037f20665b" title="Add element &#39;value&#39; at the end of the list indexed by &#39;key&#39;.">insert</a>(0, key, ptr);
<a name="l00151"></a>00151       pModel-&gt;endInsertRows();
<a name="l00152"></a>00152       <span class="keywordflow">return</span> pModel;
<a name="l00153"></a>00153    }
<a name="l00154"></a>00154 
<a name="l00155"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a5f4f38101556e7898dac439e66a34356">00155</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a5f4f38101556e7898dac439e66a34356">synchronize</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, T &amp; t)
<a name="l00156"></a>00156    {
<a name="l00157"></a>00157       <span class="keywordflow">if</span> (! pModel) { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span>; }
<a name="l00158"></a>00158       <a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;T&gt;</a> * pModelTyped = <span class="keyword">static_cast&lt;</span><a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;T&gt;</a> *<span class="keyword">&gt;</span>(pModel);
<a name="l00159"></a>00159       <a class="code" href="classqx_1_1_qx_collection.html">type_collection</a> &amp; model = pModelTyped-&gt;<a class="code" href="classqx_1_1_qx_model.html#af224b3a787360a263078e2d3c0ea843a" title="Model associated to a class registered into QxOrm context.">m_model</a>;
<a name="l00160"></a>00160       <span class="keywordflow">if</span> (model.count() &lt;= 0) { <span class="keywordflow">return</span>; }
<a name="l00161"></a>00161       <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#aaf568385fe70d3d9d57a513a66d0e288">type_ptr</a> ptr = model.getByIndex(0);
<a name="l00162"></a>00162       <span class="keywordflow">if</span> (! ptr) { <span class="keywordflow">return</span>; }
<a name="l00163"></a>00163       <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html">qx::model_view::detail::QxNestedModel_Helper&lt;T, boost::is_base_of&lt;QObject, T&gt;::value</a>&gt;<a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html#a5f4f38101556e7898dac439e66a34356">::synchronize</a>(t, (* ptr));
<a name="l00164"></a>00164    }
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 };
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00169"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html">00169</a> <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html">QxNestedModel_Container</a>
<a name="l00170"></a>00170 {
<a name="l00171"></a>00171 
<a name="l00172"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#acfede88aa68d2118e76eede93b7a7356">00172</a>    <span class="keyword">typedef</span> <a class="code" href="structqx_1_1trait_1_1generic__container.html" title="qx::trait::generic_container&lt;T&gt; : provide some tools to manage all containers without knowing its typ...">qx::trait::generic_container&lt;T&gt;</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#acfede88aa68d2118e76eede93b7a7356">type_generic_container</a>;
<a name="l00173"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a5603324dc181e3c0b07788545b2138f8">00173</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1trait_1_1no__type.html">type_generic_container::type_value_qx</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a5603324dc181e3c0b07788545b2138f8">type_data</a>;
<a name="l00174"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a05d116200b8283eb8072f04b0f3bb36a">00174</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1trait_1_1no__type.html">type_generic_container::type_item</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a05d116200b8283eb8072f04b0f3bb36a">type_item</a>;
<a name="l00175"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#aff78d79247dbccbabbc81bece7a39b80">00175</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_collection.html">qx::QxModel&lt;type_data&gt;::type_collection</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#aff78d79247dbccbabbc81bece7a39b80">type_collection</a>;
<a name="l00176"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a41235a9cd2bda0277316d0358b0c6a43">00176</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_model.html#a2d1a76e9a19ad15e645dbd6605fa7f3f">qx::QxModel&lt;type_data&gt;::type_primary_key</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a41235a9cd2bda0277316d0358b0c6a43">type_primary_key</a>;
<a name="l00177"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a99fdfb63f9ab37282373a9e515a377cc">00177</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_model.html#aef823670a8fc66b5d0c8d887034b45a6">qx::QxModel&lt;type_data&gt;::type_ptr</a> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a99fdfb63f9ab37282373a9e515a377cc">type_ptr</a>;
<a name="l00178"></a>00178 
<a name="l00179"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a5f9e7c0b5e655513d098c272da8aeef7a90e3f4c0f381af3a3497354186e2d768">00179</a>    <span class="keyword">enum</span> { <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a5f9e7c0b5e655513d098c272da8aeef7a90e3f4c0f381af3a3497354186e2d768">is_valid</a> = <a class="code" href="structqx_1_1trait_1_1is__qx__registered.html" title="qx::trait::is_qx_registered&lt;T&gt;::value : return true if T is registered into QxOrm context to provide ...">qx::trait::is_qx_registered&lt;type_data&gt;::value</a> };
<a name="l00180"></a>00180 
<a name="l00181"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#af31b2c0b9de256283099a0ca3b16ddde">00181</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#af31b2c0b9de256283099a0ca3b16ddde">create</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, T &amp; t)
<a name="l00182"></a>00182    {
<a name="l00183"></a>00183       <span class="keywordtype">int</span> iCurrRow = 0;
<a name="l00184"></a>00184       BOOST_STATIC_ASSERT(<a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a5f9e7c0b5e655513d098c272da8aeef7a90e3f4c0f381af3a3497354186e2d768">is_valid</a>);
<a name="l00185"></a>00185       <a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;type_data&gt;</a> * pModel = <span class="keyword">new</span> <a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;type_data&gt;</a>(pParent);
<a name="l00186"></a>00186       pModel-&gt;<a class="code" href="classqx_1_1_ix_model.html#ad313976add4e78d170581acc9573182e">setParentModel</a>(pParent);
<a name="l00187"></a>00187       <span class="keywordtype">long</span> lCount = <span class="keyword">static_cast&lt;</span><span class="keywordtype">long</span><span class="keyword">&gt;</span>(type_generic_container::size(t));
<a name="l00188"></a>00188       <span class="keywordflow">if</span> (lCount &lt;= 0) { <span class="keywordflow">return</span> pModel; }
<a name="l00189"></a>00189 
<a name="l00190"></a>00190       pModel-&gt;beginInsertRows(idxParent, 0, (lCount - 1));
<a name="l00191"></a>00191       <span class="keywordflow">for</span> (<span class="keyword">typename</span> T::iterator it = t.begin(); it != t.end(); ++it)
<a name="l00192"></a>00192       { <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">insertItem</a>(pModel, (* it), iCurrRow); iCurrRow++; }
<a name="l00193"></a>00193       pModel-&gt;endInsertRows();
<a name="l00194"></a>00194       <span class="keywordflow">return</span> pModel;
<a name="l00195"></a>00195    }
<a name="l00196"></a>00196 
<a name="l00197"></a>00197    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;
<a name="l00198"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#abd44ccc3cae0667b541d3a07c4c394e8">00198</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#abd44ccc3cae0667b541d3a07c4c394e8">insert</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, U &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00199"></a>00199    {
<a name="l00200"></a>00200       <span class="keywordflow">if</span> (! pModel) { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00201"></a>00201       <a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;U&gt;</a> * pModelWrk = <span class="keyword">static_cast&lt;</span><a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;U&gt;</a> *<span class="keyword">&gt;</span>(pModel);
<a name="l00202"></a>00202       <a class="code" href="classqx_1_1_qx_collection.html">type_collection</a> &amp; model = pModelWrk-&gt;<a class="code" href="classqx_1_1_qx_model.html#af224b3a787360a263078e2d3c0ea843a" title="Model associated to a class registered into QxOrm context.">m_model</a>;
<a name="l00203"></a>00203       <span class="keywordtype">long</span> &amp; idx = pModelWrk-&gt;<a class="code" href="classqx_1_1_qx_model.html#a37883f4d4971163c4e4b9c8cc7fb29ef" title="Index to insert manually items to the collection.">m_lManualInsertIndex</a>;
<a name="l00204"></a>00204       <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a41235a9cd2bda0277316d0358b0c6a43">type_primary_key</a> key;
<a name="l00205"></a>00205 
<a name="l00206"></a>00206       <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a99fdfb63f9ab37282373a9e515a377cc">type_ptr</a> ptr = <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html">qx::model_view::detail::QxNestedModel_Helper&lt;U, boost::is_base_of&lt;QObject, U&gt;::value</a>&gt;<a class="code" href="group___qx_serialize.html#ga80162fe005f1f828a4589defaca4402f" title="qx::clone(const T &amp; obj) : return a boost smart-pointer (qx_shared_ptr&lt;T&gt;) of a new instance of type ...">::clone</a>(item);
<a name="l00207"></a>00207       <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">qx::IxDataMember</a> * pDataMemberId = pModelWrk-&gt;<a class="code" href="classqx_1_1_ix_model.html#ade76aa8736c82f2d43e09d38f0b9f933" title="Primary key (property id) defined into QxOrm context.">m_pDataMemberId</a>;
<a name="l00208"></a>00208       <span class="keywordflow">if</span> (! pDataMemberId) { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00209"></a>00209       QVariant value = pDataMemberId-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aeb41e750a0e5ae206fe671cb94c7eb0f">toVariant</a>(&amp; item);
<a name="l00210"></a>00210       <span class="keywordflow">if</span> (! <a class="code" href="namespaceqx_1_1trait.html#a752ada47a935cfc82ffe1b17dadd6e72">qx::trait::is_valid_primary_key</a>(value))
<a name="l00211"></a>00211       { idx--; value = QVariant(static_cast&lt;qlonglong&gt;(idx)); }
<a name="l00212"></a>00212       <a class="code" href="namespaceqx_1_1cvt.html#a38fbb18bd04613956f3900604f5746be">qx::cvt::from_variant</a>(value, key);
<a name="l00213"></a>00213       model.insert(iRow, key, ptr);
<a name="l00214"></a>00214       <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00215"></a>00215    }
<a name="l00216"></a>00216 
<a name="l00217"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a71c526281d41d0e7b37aaadf1342fd1a">00217</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a71c526281d41d0e7b37aaadf1342fd1a">synchronize</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, T &amp; t)
<a name="l00218"></a>00218    {
<a name="l00219"></a>00219       <span class="keywordflow">if</span> (! pModel) { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span>; }
<a name="l00220"></a>00220       <a class="code" href="group___qx_cache.html#ga9334ed3464961f8d21fe022ef3a91203" title="Delete all the objects in the cache.">type_generic_container::clear</a>(t);
<a name="l00221"></a>00221       <a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;type_data&gt;</a> * pModelTyped = <span class="keyword">static_cast&lt;</span><a class="code" href="classqx_1_1_qx_model.html" title="qx::QxModel&lt;T&gt; : all classes registered into QxOrm context can be used with Qt model/view architectur...">qx::QxModel&lt;type_data&gt;</a> *<span class="keyword">&gt;</span>(pModel);
<a name="l00222"></a>00222       <a class="code" href="classqx_1_1_qx_collection.html">type_collection</a> &amp; model = pModelTyped-&gt;<a class="code" href="classqx_1_1_qx_model.html#af224b3a787360a263078e2d3c0ea843a" title="Model associated to a class registered into QxOrm context.">m_model</a>;
<a name="l00223"></a>00223 
<a name="l00224"></a>00224       <span class="keywordflow">for</span> (<span class="keywordtype">long</span> l = 0; l &lt; model.count(); l++)
<a name="l00225"></a>00225       {
<a name="l00226"></a>00226          <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a99fdfb63f9ab37282373a9e515a377cc">type_ptr</a> ptr = model.getByIndex(l); <span class="keywordflow">if</span> (! ptr) { <span class="keywordflow">continue</span>; }
<a name="l00227"></a>00227          <a class="code" href="classqx_1_1trait_1_1no__type.html">type_item</a> item = type_generic_container::createItem();
<a name="l00228"></a>00228          <a class="code" href="classqx_1_1trait_1_1no__type.html">type_data</a> &amp; item_val = item.value_qx();
<a name="l00229"></a>00229          <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___helper.html">qx::model_view::detail::QxNestedModel_Helper&lt;type_data, boost::is_base_of&lt;QObject, type_data&gt;::value</a>&gt;<a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a71c526281d41d0e7b37aaadf1342fd1a">::synchronize</a>(item_val, (* ptr));
<a name="l00230"></a>00230          QVariant vKey = QVariant(static_cast&lt;qlonglong&gt;(l));
<a name="l00231"></a>00231          <a class="code" href="namespaceqx_1_1cvt.html#a38fbb18bd04613956f3900604f5746be">qx::cvt::from_variant</a>(vKey, item.key());
<a name="l00232"></a>00232          <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">type_generic_container::insertItem</a>(t, item);
<a name="l00233"></a>00233       }
<a name="l00234"></a>00234    }
<a name="l00235"></a>00235 
<a name="l00236"></a>00236 <span class="keyword">private</span>:
<a name="l00237"></a>00237 
<a name="l00238"></a>00238    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;
<a name="l00239"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">00239</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">insertItem</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, U &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00240"></a>00240    { <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">insertItem_Helper&lt;U, boost::is_pointer&lt;U&gt;::value</a> || <a class="code" href="structqx_1_1trait_1_1is__smart__ptr.html" title="qx::trait::is_smart_ptr&lt;T&gt;::value : return true if T is a smart-pointer of boost, Qt or QxOrm librari...">qx::trait::is_smart_ptr&lt;U&gt;::value</a>&gt;<a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#abd44ccc3cae0667b541d3a07c4c394e8">::insert</a>(pModel, item, iRow); }
<a name="l00241"></a>00241 
<a name="l00242"></a>00242    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U, <span class="keywordtype">bool</span> bIsPointer <span class="comment">/* = true */</span>&gt;
<a name="l00243"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">00243</a>    <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">insertItem_Helper</a>
<a name="l00244"></a>00244    {
<a name="l00245"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">00245</a>       <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">insert</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, U &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00246"></a>00246       { <span class="keywordflow">return</span> (item ? <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html">qx::model_view::detail::QxNestedModel_Container&lt;T&gt;::insertItem</a>(pModel, (* item), iRow) : <span class="keyword">true</span>); }
<a name="l00247"></a>00247    };
<a name="l00248"></a>00248 
<a name="l00249"></a>00249    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U1, <span class="keyword">typename</span> U2&gt;
<a name="l00250"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01st3a13e934cd2bb80a16f97acf4ca533b5.html">00250</a>    <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">insertItem_Helper</a>&lt;std::pair&lt;U1, U2&gt;, false&gt;
<a name="l00251"></a>00251    {
<a name="l00252"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01st3a13e934cd2bb80a16f97acf4ca533b5.html#a18032e2b71fba6089c2e7be89a375057">00252</a>       <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">insert</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, std::pair&lt;U1, U2&gt; &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00253"></a>00253       { <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">qx::model_view::detail::QxNestedModel_Container&lt;T&gt;::insertItem</a>(pModel, item.second, iRow); }
<a name="l00254"></a>00254    };
<a name="l00255"></a>00255 
<a name="l00256"></a>00256    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U1, <span class="keyword">typename</span> U2&gt;
<a name="l00257"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01coc6fd6af12b621a697a063f2fa21cb2e7.html">00257</a>    <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">insertItem_Helper</a>&lt;const std::pair&lt;U1, U2&gt;, false&gt;
<a name="l00258"></a>00258    {
<a name="l00259"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01coc6fd6af12b621a697a063f2fa21cb2e7.html#a7da6852e475457dff5edffb6bf7b17c3">00259</a>       <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">insert</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, <span class="keyword">const</span> std::pair&lt;U1, U2&gt; &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00260"></a>00260       { <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">qx::model_view::detail::QxNestedModel_Container&lt;T&gt;::insertItem</a>(pModel, item.second, iRow); }
<a name="l00261"></a>00261    };
<a name="l00262"></a>00262 
<a name="l00263"></a>00263    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U1, <span class="keyword">typename</span> U2&gt;
<a name="l00264"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01_qa5bd8c2f1a367d006d3f511953a60607.html">00264</a>    <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">insertItem_Helper</a>&lt;QPair&lt;U1, U2&gt;, false&gt;
<a name="l00265"></a>00265    {
<a name="l00266"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01_qa5bd8c2f1a367d006d3f511953a60607.html#a8b80e7f80e820d1ee536d33dc03baa07">00266</a>       <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">insert</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, QPair&lt;U1, U2&gt; &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00267"></a>00267       { <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">qx::model_view::detail::QxNestedModel_Container&lt;T&gt;::insertItem</a>(pModel, item.second, iRow); }
<a name="l00268"></a>00268    };
<a name="l00269"></a>00269 
<a name="l00270"></a>00270    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U1, <span class="keyword">typename</span> U2&gt;
<a name="l00271"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01co85a1fca6e8ffc42059ccbd04846e522b.html">00271</a>    <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">insertItem_Helper</a>&lt;const QPair&lt;U1, U2&gt;, false&gt;
<a name="l00272"></a>00272    {
<a name="l00273"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01co85a1fca6e8ffc42059ccbd04846e522b.html#ad53fd58e558a41529c6fd2951602dbc5">00273</a>       <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">insert</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, <span class="keyword">const</span> QPair&lt;U1, U2&gt; &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00274"></a>00274       { <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html#a325ec2c40f4b4669223a5835616588c6">qx::model_view::detail::QxNestedModel_Container&lt;T&gt;::insertItem</a>(pModel, item.second, iRow); }
<a name="l00275"></a>00275    };
<a name="l00276"></a>00276 
<a name="l00277"></a>00277    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;
<a name="l00278"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01_u_00_01false_01_4.html">00278</a>    <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html">insertItem_Helper</a>&lt;U, false&gt;
<a name="l00279"></a>00279    {
<a name="l00280"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01_u_00_01false_01_4.html#ae7724d432fe58f1b38086fca116b9b0ca07058d892665031c9cb6ca754cd4ab3b">00280</a>       <span class="keyword">enum</span> { is_same_type = boost::is_same&lt;qx::model_view::detail::QxNestedModel_Container&lt;T&gt;::type_data, U&gt;::value };
<a name="l00281"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper_3_01_u_00_01false_01_4.html#a28646576cf88dc3d2e423e18d6ed92e6">00281</a>       <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">insert</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, U &amp; item, <span class="keywordtype">int</span> iRow)
<a name="l00282"></a>00282       { BOOST_STATIC_ASSERT(is_same_type); <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container_1_1insert_item___helper.html#a6f30dff8c8f05bc6e551bb0d35e119bf">qx::model_view::detail::QxNestedModel_Container&lt;T&gt;::insert</a>(pModel, item, iRow); }
<a name="l00283"></a>00283    };
<a name="l00284"></a>00284 
<a name="l00285"></a>00285 };
<a name="l00286"></a>00286 
<a name="l00287"></a>00287 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00288"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html">00288</a> <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html">QxNestedModel_Ptr</a>
<a name="l00289"></a>00289 {
<a name="l00290"></a>00290 
<a name="l00291"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a50f5a98fc2de2d09787e244b710e933e">00291</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a50f5a98fc2de2d09787e244b710e933e">create</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, T &amp; t)
<a name="l00292"></a>00292    { <span class="keywordflow">return</span> (t ? <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a71eeab1f25e3d3d2aa79fb09744534bb">create_Helper</a>(pParent, idxParent, (* t)) : <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a34b412d866c68d7d4458fcd02c5c7b43">create_NullHelper</a>(pParent, idxParent)); }
<a name="l00293"></a>00293 
<a name="l00294"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#ad18d17fe04cc162c58bc5b6b5cf6fee9">00294</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#ad18d17fe04cc162c58bc5b6b5cf6fee9">synchronize</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, T &amp; t)
<a name="l00295"></a>00295    { <span class="keywordflow">if</span> (! t) { <a class="code" href="group___qx_cache.html#gaf467221c40ed6d8960109a8a00c3e3fa" title="Return the object of type T associated with key sKey, or return default instance of T() if the key do...">qx::trait::construct_ptr&lt;T&gt;::get</a>(t); }; <span class="keywordflow">if</span> (t) { <a class="code" href="namespaceqx_1_1model__view.html#a9aac50c627ca489db543c8aad5f238af">qx::model_view::sync_nested_model</a>(pModel, (* t)); } }
<a name="l00296"></a>00296 
<a name="l00297"></a>00297 <span class="keyword">private</span>:
<a name="l00298"></a>00298 
<a name="l00299"></a>00299    <span class="keyword">template</span> &lt;<span class="keyword">class</span> U&gt;
<a name="l00300"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a71eeab1f25e3d3d2aa79fb09744534bb">00300</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a71eeab1f25e3d3d2aa79fb09744534bb">create_Helper</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, U &amp; u)
<a name="l00301"></a>00301    { <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a50f5a98fc2de2d09787e244b710e933e">qx::model_view::detail::QxNestedModel&lt;U&gt;::create</a>(pParent, idxParent, u); }
<a name="l00302"></a>00302 
<a name="l00303"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a34b412d866c68d7d4458fcd02c5c7b43">00303</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html#a34b412d866c68d7d4458fcd02c5c7b43">create_NullHelper</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent)
<a name="l00304"></a>00304    {
<a name="l00305"></a>00305       T t; <a class="code" href="group___qx_cache.html#gaf467221c40ed6d8960109a8a00c3e3fa" title="Return the object of type T associated with key sKey, or return default instance of T() if the key do...">qx::trait::construct_ptr&lt;T&gt;::get</a>(t);
<a name="l00306"></a>00306       <span class="keywordflow">if</span> (! t) { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> NULL; }
<a name="l00307"></a>00307       <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel = <a class="code" href="group___qx_model_view.html#ga9e77a51135648a509862472efb28d6dd" title="qx::model_view::create_nested_model is used by QxEntityEditor to manage complex data structure to wor...">qx::model_view::create_nested_model</a>(pParent, idxParent, (* t));
<a name="l00308"></a>00308       <span class="keywordflow">if</span> (pModel) { pModel-&gt;<a class="code" href="classqx_1_1_ix_model.html#a9dcc6de207be096a869911b4b4739414">clear</a>(); } <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(pModel != NULL);
<a name="l00309"></a>00309       <span class="keywordflow">return</span> pModel;
<a name="l00310"></a>00310    }
<a name="l00311"></a>00311 
<a name="l00312"></a>00312 };
<a name="l00313"></a>00313 
<a name="l00314"></a>00314 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00315"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html">00315</a> <span class="keyword">struct </span><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html">QxNestedModel</a>
<a name="l00316"></a>00316 {
<a name="l00317"></a>00317 
<a name="l00318"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a732d6775b014bb05bfefb003abf5f9fd">00318</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> boost::mpl::if_c&lt; boost::is_pointer&lt;T&gt;::value, <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html">qx::model_view::detail::QxNestedModel_Ptr&lt;T&gt;</a>, <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___generic.html">qx::model_view::detail::QxNestedModel_Generic&lt;T&gt;</a> &gt;::type <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a732d6775b014bb05bfefb003abf5f9fd">type_model_view_1</a>;
<a name="l00319"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a14d5318a15d984db359fd14a9379083e">00319</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> boost::mpl::if_c&lt; qx::trait::is_smart_ptr&lt;T&gt;::value, <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___ptr.html">qx::model_view::detail::QxNestedModel_Ptr&lt;T&gt;</a>, <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a732d6775b014bb05bfefb003abf5f9fd">type_model_view_1</a> &gt;::type <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a14d5318a15d984db359fd14a9379083e">type_model_view_2</a>;
<a name="l00320"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#af81d98f8ddcb615bf8a08696e7a4cfb3">00320</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> boost::mpl::if_c&lt; qx::trait::is_container&lt;T&gt;::value, <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model___container.html">qx::model_view::detail::QxNestedModel_Container&lt;T&gt;</a>, <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a14d5318a15d984db359fd14a9379083e">type_model_view_2</a> &gt;::type <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#af81d98f8ddcb615bf8a08696e7a4cfb3">type_model_view_3</a>;
<a name="l00321"></a>00321 
<a name="l00322"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a095285c124bdabdc96619d8bb49b893e">00322</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a095285c124bdabdc96619d8bb49b893e">create</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, T &amp; t)
<a name="l00323"></a>00323    { <span class="keywordflow">return</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#a095285c124bdabdc96619d8bb49b893e">type_model_view_3::create</a>(pParent, idxParent, t); }
<a name="l00324"></a>00324 
<a name="l00325"></a><a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#aafdf56a06a72f2649b65c3fb6501b50a">00325</a>    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#aafdf56a06a72f2649b65c3fb6501b50a">synchronize</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, T &amp; t)
<a name="l00326"></a>00326    { <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html#aafdf56a06a72f2649b65c3fb6501b50a">type_model_view_3::synchronize</a>(pModel, t); }
<a name="l00327"></a>00327 
<a name="l00328"></a>00328 };
<a name="l00329"></a>00329 
<a name="l00330"></a>00330 } <span class="comment">// namespace detail</span>
<a name="l00331"></a>00331 } <span class="comment">// namespace model_view</span>
<a name="l00332"></a>00332 } <span class="comment">// namespace qx</span>
<a name="l00333"></a>00333 
<a name="l00334"></a>00334 <span class="keyword">namespace </span>qx {
<a name="l00335"></a>00335 <span class="keyword">namespace </span>model_view {
<a name="l00336"></a>00336 
<a name="l00344"></a>00344 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00345"></a><a class="code" href="group___qx_model_view.html#ga9e77a51135648a509862472efb28d6dd">00345</a> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="group___qx_model_view.html#ga9e77a51135648a509862472efb28d6dd" title="qx::model_view::create_nested_model is used by QxEntityEditor to manage complex data structure to wor...">create_nested_model</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, T &amp; t)
<a name="l00346"></a>00346 { <span class="keywordflow">return</span> <a class="code" href="group___qx_factory.html#ga0bc0922522ca27cff4af086f9b63977d" title="Return a smart-pointer new instance of object (qx_shared_ptr&lt;T&gt;) associated by key sKey using boost::...">qx::model_view::detail::QxNestedModel&lt;T&gt;::create</a>(pParent, idxParent, t); }
<a name="l00347"></a>00347 
<a name="l00348"></a>00348 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T, <span class="keyword">class</span> U&gt;
<a name="l00349"></a><a class="code" href="namespaceqx_1_1model__view.html#a62f744adc353b0d1f5a50523536134be">00349</a> <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * <a class="code" href="namespaceqx_1_1model__view.html#a62f744adc353b0d1f5a50523536134be">create_nested_model_with_type</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pParent, <span class="keyword">const</span> QModelIndex &amp; idxParent, T &amp; t, U * dummy)
<a name="l00350"></a>00350 {
<a name="l00351"></a>00351    Q_UNUSED(dummy);
<a name="l00352"></a>00352    BOOST_STATIC_ASSERT((boost::is_base_of&lt;qx::IxModel, U&gt;::value));
<a name="l00353"></a>00353    <a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel = <a class="code" href="group___qx_model_view.html#ga9e77a51135648a509862472efb28d6dd" title="qx::model_view::create_nested_model is used by QxEntityEditor to manage complex data structure to wor...">qx::model_view::create_nested_model</a>(pParent, idxParent, t);
<a name="l00354"></a>00354    <span class="keywordflow">if</span> (! pModel) { <span class="keywordflow">return</span> NULL; }
<a name="l00355"></a>00355    U * pOther = <span class="keyword">new</span> U(pModel, pParent);
<a name="l00356"></a>00356    <span class="keyword">delete</span> pModel;
<a name="l00357"></a>00357    <span class="keywordflow">return</span> pOther;
<a name="l00358"></a>00358 }
<a name="l00359"></a>00359 
<a name="l00360"></a>00360 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00361"></a><a class="code" href="namespaceqx_1_1model__view.html#a9aac50c627ca489db543c8aad5f238af">00361</a> <span class="keywordtype">void</span> <a class="code" href="namespaceqx_1_1model__view.html#a9aac50c627ca489db543c8aad5f238af">sync_nested_model</a>(<a class="code" href="classqx_1_1_ix_model.html" title="qx::IxModel : interface to manage Qt model/view architecture with classes registered into QxOrm conte...">qx::IxModel</a> * pModel, T &amp; t)
<a name="l00362"></a>00362 { <a class="code" href="structqx_1_1model__view_1_1detail_1_1_qx_nested_model.html">qx::model_view::detail::QxNestedModel&lt;T&gt;::synchronize</a>(pModel, t); }
<a name="l00363"></a>00363 
<a name="l00364"></a>00364 } <span class="comment">// namespace model_view</span>
<a name="l00365"></a>00365 } <span class="comment">// namespace qx</span>
<a name="l00366"></a>00366 
<a name="l00367"></a>00367 <span class="preprocessor">#endif // _QX_NESTED_MODEL_H_</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_qx_nested_model_8h.html">QxNestedModel.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Dec 11 2016 13:41:04 for QxOrm by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
